From 4d4a2e9d227a6a87ae61d4a62f1831bdaf8e8c2b Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Thu, 9 Feb 2006 08:48:47 -0700 Subject: [PATCH] [IA64] added multicall This patch added multicall hypercall. Signed-off-by: Masaki Kanno --- xen/arch/ia64/xen/hypercall.c | 43 +++++++++++++++++++++++++++++++- xen/include/asm-ia64/multicall.h | 24 +++++++++++++++++- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/xen/arch/ia64/xen/hypercall.c b/xen/arch/ia64/xen/hypercall.c index 34ebd0b355..355fbd6b7e 100644 --- a/xen/arch/ia64/xen/hypercall.c +++ b/xen/arch/ia64/xen/hypercall.c @@ -9,6 +9,7 @@ #include #include #include +#include #include /* FOR EFI_UNIMPLEMENTED */ #include /* FOR struct ia64_sal_retval */ @@ -23,6 +24,42 @@ extern unsigned long translate_domain_mpaddr(unsigned long); unsigned long idle_when_pending = 0; unsigned long pal_halt_light_count = 0; +hypercall_t ia64_hypercall_table[] = + { + (hypercall_t)do_ni_hypercall, /* do_set_trap_table */ /* 0 */ + (hypercall_t)do_ni_hypercall, /* do_mmu_update */ + (hypercall_t)do_ni_hypercall, /* do_set_gdt */ + (hypercall_t)do_ni_hypercall, /* do_stack_switch */ + (hypercall_t)do_ni_hypercall, /* do_set_callbacks */ + (hypercall_t)do_ni_hypercall, /* do_fpu_taskswitch */ /* 5 */ + (hypercall_t)do_ni_hypercall, /* do_sched_op */ + (hypercall_t)do_dom0_op, + (hypercall_t)do_ni_hypercall, /* do_set_debugreg */ + (hypercall_t)do_ni_hypercall, /* do_get_debugreg */ + (hypercall_t)do_ni_hypercall, /* do_update_descriptor */ /* 10 */ + (hypercall_t)do_ni_hypercall, /* do_ni_hypercall */ + (hypercall_t)do_memory_op, + (hypercall_t)do_multicall, + (hypercall_t)do_ni_hypercall, /* do_update_va_mapping */ + (hypercall_t)do_ni_hypercall, /* do_set_timer_op */ /* 15 */ + (hypercall_t)do_event_channel_op, + (hypercall_t)do_xen_version, + (hypercall_t)do_console_io, + (hypercall_t)do_ni_hypercall, /* do_physdev_op */ + (hypercall_t)do_grant_table_op, /* 20 */ + (hypercall_t)do_ni_hypercall, /* do_vm_assist */ + (hypercall_t)do_ni_hypercall, /* do_update_va_mapping_otherdomain */ + (hypercall_t)do_ni_hypercall, /* (x86 only) */ + (hypercall_t)do_ni_hypercall, /* do_vcpu_op */ + (hypercall_t)do_ni_hypercall, /* (x86_64 only) */ /* 25 */ + (hypercall_t)do_ni_hypercall, /* do_mmuext_op */ + (hypercall_t)do_ni_hypercall, /* do_acm_op */ + (hypercall_t)do_ni_hypercall, /* do_nmi_op */ + (hypercall_t)do_ni_hypercall, /* */ + (hypercall_t)do_ni_hypercall, /* */ /* 30 */ + (hypercall_t)do_ni_hypercall /* */ + }; + int ia64_hypercall (struct pt_regs *regs) { @@ -181,9 +218,13 @@ ia64_hypercall (struct pt_regs *regs) regs->r8 = do_xen_version(regs->r14, regs->r15); break; + case __HYPERVISOR_multicall: + regs->r8 = do_multicall(regs->r14, regs->r15); + break; + default: printf("unknown hypercall %x\n", regs->r2); - regs->r8 = (unsigned long)-1; + regs->r8 = do_ni_hypercall(); } return 1; } diff --git a/xen/include/asm-ia64/multicall.h b/xen/include/asm-ia64/multicall.h index 8e7953bece..53bb171c32 100644 --- a/xen/include/asm-ia64/multicall.h +++ b/xen/include/asm-ia64/multicall.h @@ -1,5 +1,27 @@ #ifndef __ASM_IA64_MULTICALL_H__ #define __ASM_IA64_MULTICALL_H__ -#define do_multicall_call(_call) BUG() +#include + +typedef unsigned long (*hypercall_t)( + unsigned long arg0, + unsigned long arg1, + unsigned long arg2, + unsigned long arg3, + unsigned long arg4, + unsigned long arg5); + +extern hypercall_t ia64_hypercall_table[]; + +static inline void do_multicall_call(multicall_entry_t *call) +{ + call->result = (*ia64_hypercall_table[call->op])( + call->args[0], + call->args[1], + call->args[2], + call->args[3], + call->args[4], + call->args[5]); +} + #endif /* __ASM_IA64_MULTICALL_H__ */ -- 2.30.2